// components/RelateItem/RelateItem.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    relItem:{
      type:Object,
      value:null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    relList:[]
  },
 
  attached(){
    wx.showLoading({
      title: '正在加载···',
    })
    let {list} =this.properties.relItem
    list.forEach((item)=>{
      let time = item.duration;
      item.time = this.getVideoTime(time);
    })
    this.setData({
      relList:list
    })
  },
  ready(){
    wx.hideLoading()
  },
  /**
   * 组件的方法列表
   */
  methods: {
    getVideoTime(time){
      let m = Math.floor(time/60);
      let s= time%60;
      m=m<10?"0"+m:m;
      s=s<10?"0"+s:s;
      let str= `${m}'${s}''`;
      return str;
    }
  }
})
